use BAMPrimaryImport 
--Select * From dbo.bam_BatchingActivity_AllInstances
--select * From dbo.bam_BatchInterchangeActivity_AllInstances 
--select * from dbo.bam_BusinessMessageJournal_AllInstances 
--select * from dbo.bam_FunctionalAckActivity_AllInstances 
select * from dbo.bam_FunctionalGroupInfo_AllInstances 
--select * from dbo.bam_InterchangeAckActivity_AllInstances
select * from dbo.bam_InterchangeStatusActivity_AllInstances
--select * from dbo.bam_ResendJournalActivity_AllInstances
--select * from dbo.bam_ResendTrackingActivity_AllInstances
select * from dbo.bam_TransactionSetActivity_AllInstances

select COUNT(*) from dbo.bam_FunctionalGroupInfo_Completed where PickedUp is NULL 

update dbo.bam_FunctionalGroupInfo_Completed set PickedUp = NULL where PickedUp='Y'